#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <left4dhooks>

public Plugin myinfo =
{
	name = "l4d2_witch_shove_damage",
	author = "豆瓣酱な",
	description = "witch被推踉跄效果.",
	version = "1.0",
	url = "https://gitee.com/sweet-and-sour-bombs/adfvsdsd"
}

public void OnPluginStart()
{
	HookEvent("entity_shoved", Event_EntityShoved);
}

public void Event_EntityShoved(Event event, const char[] name, bool dontBroadcast)
{
	int entity = event.GetInt("entityid");
	int attacker = event.GetInt("attacker");

	if (!IsValidEntity(entity) || !IsValidEntity(attacker))
	return;

	char model[128];
	GetEntPropString(entity, Prop_Data, "m_ModelName", model, sizeof(model));

	if (StrEqual(model, "models/infected/witch.mdl") || StrEqual(model, "models/infected/witch_bride.mdl"))
	{
		// 对女巫造成 10 点爆炸伤害 ps:爆炸伤害会对女巫造成硬直.
		SDKHooks_TakeDamage(entity, attacker, attacker, 10.0, DMG_BLAST);
	}
}